{smcl}
{com}{sf}{ul off}{txt}{.-}
      name:  {res}<unnamed>
       {txt}log:  {res}C:\Users\jp18390\Dropbox\DISCRIMINATION PROJECT (U.S. FEDERAL AGENCIES)\Age Discrimination Project\Organizational Justice_Factor Scores 2010-2019\FEVS_2017.smcl
  {txt}log type:  {res}smcl
 {txt}opened on:  {res}17 Jun 2021, 23:13:17

{com}. import delimited "C:\Users\jp18390\Dropbox\DISCRIMINATION PROJECT (U.S. FEDERAL AGENCIES)\FEVS\FEVS_2010-2019\FEVS_2017_PRDF.csv"
{res}{text}(80 vars, 486,105 obs)

{com}. svyset [pweight=postwt]

      {txt}pweight:{col 16}{res}postwt
          {txt}VCE:{col 16}{res}linearized
  {txt}Single unit:{col 16}{res}missing
     {txt}Strata 1:{col 16}<one>
         SU 1:{col 16}<observations>
        FPC 1:{col 16}<zero>
{p2colreset}{...}

{com}. 
. 
. 
. 
. 
. drop if q17=="X"
{txt}(19,717 observations deleted)

{com}. 
. drop if q17==""
{txt}(3,509 observations deleted)

{com}. 
. drop if q37=="X"
{txt}(20,191 observations deleted)

{com}. 
. drop if q37==""
{txt}(10,651 observations deleted)

{com}. 
. drop if q38=="X"
{txt}(18,180 observations deleted)

{com}. 
. drop if q38==""
{txt}(3,801 observations deleted)

{com}. 
. drop if q15=="X"
{txt}(3,576 observations deleted)

{com}. 
. drop if q15==""
{txt}(1,224 observations deleted)

{com}. 
. drop if q22=="X"
{txt}(16,513 observations deleted)

{com}. 
. drop if q22==""
{txt}(2,135 observations deleted)

{com}. 
. drop if q25=="X"
{txt}(9,487 observations deleted)

{com}. 
. drop if q25==""
{txt}(2,258 observations deleted)

{com}. 
. drop if q33=="X"
{txt}(8,074 observations deleted)

{com}. 
. drop if q33==""
{txt}(2,780 observations deleted)

{com}. 
. drop if q48==.
{txt}(2,750 observations deleted)

{com}. 
. drop if q49==.
{txt}(1,325 observations deleted)

{com}. 
. 
. 
. destring q17, replace
{txt}q17: all characters numeric; {res}replaced {txt}as {res}byte

{com}. 
. destring q37, replace
{txt}q37: all characters numeric; {res}replaced {txt}as {res}byte

{com}. 
. destring q38, replace
{txt}q38: all characters numeric; {res}replaced {txt}as {res}byte

{com}. 
. destring q15, replace
{txt}q15: all characters numeric; {res}replaced {txt}as {res}byte

{com}. 
. destring q22, replace
{txt}q22: all characters numeric; {res}replaced {txt}as {res}byte

{com}. 
. destring q25, replace
{txt}q25: all characters numeric; {res}replaced {txt}as {res}byte

{com}. 
. destring q33, replace
{txt}q33: all characters numeric; {res}replaced {txt}as {res}byte

{com}. 
. 
. 
. svy linearized : sem (JUSTICE -> DISTRIBUTIVE, ) (JUSTICE -> PROCEDURAL, ) (JUSTICE -> INTERPERSONAL, ) (DISTRIBUTIVE -> q22, ) (DISTRIBUTIVE -> q25, ) (DISTRIBUTIVE -> q33, ) (PROCEDURAL -> q15, ) (PROCEDURAL -> q17, ) (PROCEDURAL -> q37, ) (PROCEDURAL -> q38, )(INTERPERSONAL -> q48, ) (INTERPERSONAL -> q49, ), standardized latent(JUSTICE DISTRIBUTIVE PROCEDURAL INTERPERSONAL ) nocapslatent
{txt}(running sem on estimation sample)
{res}
{txt}{col 1}Survey: Structural equation model{col 49}Number of obs{col 67}= {res}   359,934
{txt}{col 1}Number of strata{col 22}= {res}        1{txt}{col 49}Population size{col 67}={res}  1,347,201
{txt}{col 1}Number of PSUs{col 22}= {res}  359,934{txt}{col 49}Design df{col 67}= {res}   359,933

{p 0 7}{space 1}{text:( 1)}{space 1} [q22]DISTRIBUTIVE = 1{p_end}
{p 0 7}{space 1}{text:( 2)}{space 1} [q15]PROCEDURAL = 1{p_end}
{p 0 7}{space 1}{text:( 3)}{space 1} [q48]INTERPERSONAL = 1{p_end}
{p 0 7}{space 1}{text:( 4)}{space 1} [DISTRIBUTIVE]JUSTICE = 1{p_end}
{txt}{hline 20}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 21}{c |}{col 33}  Linearized
{col 1}       Standardized{col 21}{c |}      Coef.{col 33}   Std. Err.{col 45}      t{col 53}   P>|t|{col 61}     [95% Con{col 74}f. Interval]
{hline 20}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 1}{res}Structural         {col 21}{txt}{c |}
{space 2}{col 3}DISTRIBUTIVE     {col 21}{c |}
{space 12}JUSTICE {c |}{col 21}{res}{space 2} .8477698{col 33}{space 2} .0017132{col 44}{space 1}  494.84{col 53}{space 3}0.000{col 61}{space 4} .8444119{col 74}{space 3} .8511277
{space 2}{txt}{hline 18}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 2}{col 3}PROCEDURAL       {col 21}{c |}
{space 12}JUSTICE {c |}{col 21}{res}{space 2} .9836996{col 33}{space 2} .0017781{col 44}{space 1}  553.24{col 53}{space 3}0.000{col 61}{space 4} .9802147{col 74}{space 3} .9871846
{space 2}{txt}{hline 18}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 2}{col 3}INTERPERSONAL    {col 21}{c |}
{space 12}JUSTICE {c |}{col 21}{res}{space 2} .7096471{col 33}{space 2} .0020331{col 44}{space 1}  349.05{col 53}{space 3}0.000{col 61}{space 4} .7056622{col 74}{space 3} .7136319
{txt}{hline 20}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 1}{res}Measurement        {col 21}{txt}{c |}
{space 2}{col 3}q22              {col 21}{c |}
{space 7}DISTRIBUTIVE {c |}{col 21}{res}{space 2} .8458524{col 33}{space 2} .0012442{col 44}{space 1}  679.85{col 53}{space 3}0.000{col 61}{space 4} .8434139{col 74}{space 3} .8482909
{txt}{space 14}_cons {c |}{col 21}{res}{space 2} 2.385849{col 33}{space 2} .0045885{col 44}{space 1}  519.96{col 53}{space 3}0.000{col 61}{space 4} 2.376856{col 74}{space 3} 2.394843
{space 2}{txt}{hline 18}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 2}{col 3}q25              {col 21}{c |}
{space 7}DISTRIBUTIVE {c |}{col 21}{res}{space 2} .8406525{col 33}{space 2} .0012887{col 44}{space 1}  652.33{col 53}{space 3}0.000{col 61}{space 4} .8381267{col 74}{space 3} .8431783
{txt}{space 14}_cons {c |}{col 21}{res}{space 2} 2.513869{col 33}{space 2}  .005156{col 44}{space 1}  487.56{col 53}{space 3}0.000{col 61}{space 4} 2.503764{col 74}{space 3} 2.523975
{space 2}{txt}{hline 18}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 2}{col 3}q33              {col 21}{c |}
{space 7}DISTRIBUTIVE {c |}{col 21}{res}{space 2} .7216843{col 33}{space 2} .0017174{col 44}{space 1}  420.22{col 53}{space 3}0.000{col 61}{space 4} .7183183{col 74}{space 3} .7250503
{txt}{space 14}_cons {c |}{col 21}{res}{space 2} 2.214527{col 33}{space 2} .0037904{col 44}{space 1}  584.25{col 53}{space 3}0.000{col 61}{space 4} 2.207098{col 74}{space 3} 2.221956
{space 2}{txt}{hline 18}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 2}{col 3}q15              {col 21}{c |}
{space 9}PROCEDURAL {c |}{col 21}{res}{space 2} .6335576{col 33}{space 2} .0023834{col 44}{space 1}  265.82{col 53}{space 3}0.000{col 61}{space 4} .6288862{col 74}{space 3} .6382291
{txt}{space 14}_cons {c |}{col 21}{res}{space 2} 3.318674{col 33}{space 2} .0089203{col 44}{space 1}  372.04{col 53}{space 3}0.000{col 61}{space 4}  3.30119{col 74}{space 3} 3.336157
{space 2}{txt}{hline 18}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 2}{col 3}q17              {col 21}{c |}
{space 9}PROCEDURAL {c |}{col 21}{res}{space 2} .7755968{col 33}{space 2} .0016299{col 44}{space 1}  475.87{col 53}{space 3}0.000{col 61}{space 4} .7724024{col 74}{space 3} .7787913
{txt}{space 14}_cons {c |}{col 21}{res}{space 2} 2.961087{col 33}{space 2} .0073278{col 44}{space 1}  404.09{col 53}{space 3}0.000{col 61}{space 4} 2.946725{col 74}{space 3} 2.975449
{space 2}{txt}{hline 18}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 2}{col 3}q37              {col 21}{c |}
{space 9}PROCEDURAL {c |}{col 21}{res}{space 2} .8366446{col 33}{space 2} .0014221{col 44}{space 1}  588.32{col 53}{space 3}0.000{col 61}{space 4} .8338573{col 74}{space 3} .8394318
{txt}{space 14}_cons {c |}{col 21}{res}{space 2} 2.733938{col 33}{space 2} .0062429{col 44}{space 1}  437.93{col 53}{space 3}0.000{col 61}{space 4} 2.721703{col 74}{space 3} 2.746174
{space 2}{txt}{hline 18}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 2}{col 3}q38              {col 21}{c |}
{space 9}PROCEDURAL {c |}{col 21}{res}{space 2} .8211562{col 33}{space 2} .0015799{col 44}{space 1}  519.76{col 53}{space 3}0.000{col 61}{space 4} .8180597{col 74}{space 3} .8242527
{txt}{space 14}_cons {c |}{col 21}{res}{space 2} 3.306357{col 33}{space 2} .0088721{col 44}{space 1}  372.67{col 53}{space 3}0.000{col 61}{space 4} 3.288968{col 74}{space 3} 3.323746
{space 2}{txt}{hline 18}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 2}{col 3}q48              {col 21}{c |}
{space 6}INTERPERSONAL {c |}{col 21}{res}{space 2} .9403663{col 33}{space 2} .0011044{col 44}{space 1}  851.46{col 53}{space 3}0.000{col 61}{space 4} .9382016{col 74}{space 3} .9425309
{txt}{space 14}_cons {c |}{col 21}{res}{space 2} 3.764349{col 33}{space 2}  .010739{col 44}{space 1}  350.53{col 53}{space 3}0.000{col 61}{space 4} 3.743301{col 74}{space 3} 3.785397
{space 2}{txt}{hline 18}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 2}{col 3}q49              {col 21}{c |}
{space 6}INTERPERSONAL {c |}{col 21}{res}{space 2} .9180683{col 33}{space 2} .0011917{col 44}{space 1}  770.37{col 53}{space 3}0.000{col 61}{space 4} .9157326{col 74}{space 3} .9204041
{txt}{space 14}_cons {c |}{col 21}{res}{space 2} 4.119849{col 33}{space 2} .0129281{col 44}{space 1}  318.67{col 53}{space 3}0.000{col 61}{space 4}  4.09451{col 74}{space 3} 4.145188
{txt}{hline 20}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 10}var(e.q22){c |}{col 21}{res}{space 2} .2845337{col 33}{space 2} .0021048{col 61}{space 4} .2804382{col 74}{space 3} .2886891
{txt}{space 10}var(e.q25){c |}{col 21}{res}{space 2} .2933033{col 33}{space 2} .0021667{col 61}{space 4} .2890873{col 74}{space 3} .2975809
{txt}{space 10}var(e.q33){c |}{col 21}{res}{space 2} .4791718{col 33}{space 2} .0024788{col 61}{space 4} .4743379{col 74}{space 3} .4840549
{txt}{space 10}var(e.q15){c |}{col 21}{res}{space 2} .5986047{col 33}{space 2} .0030201{col 61}{space 4} .5927146{col 74}{space 3} .6045534
{txt}{space 10}var(e.q17){c |}{col 21}{res}{space 2} .3984496{col 33}{space 2} .0025282{col 61}{space 4}  .393525{col 74}{space 3} .4034357
{txt}{space 10}var(e.q37){c |}{col 21}{res}{space 2} .3000258{col 33}{space 2} .0023796{col 61}{space 4}  .295398{col 74}{space 3} .3047261
{txt}{space 10}var(e.q38){c |}{col 21}{res}{space 2} .3257026{col 33}{space 2} .0025946{col 61}{space 4} .3206566{col 74}{space 3} .3308279
{txt}{space 10}var(e.q48){c |}{col 21}{res}{space 2} .1157113{col 33}{space 2} .0020771{col 61}{space 4}  .111711{col 74}{space 3} .1198548
{txt}{space 10}var(e.q49){c |}{col 21}{res}{space 2} .1571505{col 33}{space 2} .0021882{col 61}{space 4} .1529198{col 74}{space 3} .1614983
{txt}{space 1}var(e.DISTRIBUTIVE){c |}{col 21}{res}{space 2} .2812864{col 33}{space 2} .0029048{col 61}{space 4} .2756502{col 74}{space 3} .2870378
{txt}{space 3}var(e.PROCEDURAL){c |}{col 21}{res}{space 2}  .032335{col 33}{space 2} .0034982{col 61}{space 4} .0261568{col 74}{space 3} .0399725
{txt}var(e.INTERPERSONAL){c |}{col 21}{res}{space 2}  .496401{col 33}{space 2} .0028856{col 61}{space 4} .4907775{col 74}{space 3}  .502089
{txt}{space 8}var(JUSTICE){c |}{col 21}{res}{space 2}        1{col 33}{space 2}        .{col 61}{space 4}        .{col 74}{space 3}        .
{txt}{hline 20}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}

{com}. 
. 
. 
. estat gof, stats(all)
{res}
{txt}{hline 21}{c TT}{hline 54}
{lalign 21:Fit statistic}{c |}      Value   Description
{hline 21}{c +}{hline 54}
{lalign 21:Size of residuals}{c |}
{ralign 20:SRMR} {c |} {res}{ralign 10:     0.038}{txt}   Standardized root mean squared residual
{ralign 20:CD} {c |} {res}{ralign 10:     0.971}{txt}   Coefficient of determination
{hline 21}{c BT}{hline 54}
{p 0 2 2 75}Note: model was fit with{txt} svy: prefix; only stats(residuals) valid.{p_end}

{com}. predict justice, latent(JUSTICE)
{res}
{com}. 
. 
. 
. egen average_justice = mean (justice), by (agency)

. 
. 
. 
. egen sub_average_justice = mean (justice), by (level1)

. save "C:\Users\jp18390\Dropbox\DISCRIMINATION PROJECT (U.S. FEDERAL AGENCIES)\Age Discrimination Project\Organizational Justice_Factor Scores 2010-2019\2017FEVS_Justice.dta"
{txt}file C:\Users\jp18390\Dropbox\DISCRIMINATION PROJECT (U.S. FEDERAL AGENCIES)\Age Discrimination Project\Organizational Justice_Factor Scores 2010-2019\2017FEVS_Justice.dta saved

{com}. exit, clear
